#ifndef __TOUCHSCREEN_H
#define __TOUCHSCREEN_H

#ifdef __cplusplus
 extern "C" {
#endif
	 
#include "System.h"

#if ENABLE_TOUCH

#include "Board.h"
#include "input.h"

/* Set Multi-touch as supported */
#if !defined(TS_MULTI_TOUCH_SUPPORTED)
#define TS_MULTI_TOUCH_SUPPORTED        0
#endif /* TS_MONO_TOUCH_SUPPORTED */

#define Touch_MAX          32
#define TOUCH_MAX_WIDTH 	1024
#define TOUCH_MAX_HEIGHT 	600

#define Touch_RST_HI()		HAL_GPIO_WritePin(TP_RST_PORT, TP_RST_PIN, GPIO_PIN_SET)
#define Touch_RST_LOW()		HAL_GPIO_WritePin(TP_RST_PORT, TP_RST_PIN, GPIO_PIN_RESET)
	 
typedef struct{
	UINT16 	TouchID;
    UINT8 	TouchVer;
}TouchInfo;
typedef struct{
	UINT8	id;
	UINT8 	status;
	UINT16 	x;
	UINT16 	y;
}Coord;


typedef struct{
	TouchInfo	*info;
    void 		(*init)(void);
	void 		(*rest)(void);
}TouchDriver_T;

extern TouchDriver_T	g_touchDriver;

void 	TouchScreen_Reset(void);
void 	TouchScreen_Init(void);
UINT8	TouchScreen_Read(void);

	
#endif
	 
#ifdef __cplusplus
}
#endif
#endif
